class BrewingStandRenderer : public IBlockRenderer
{
public:
	ITexture *Texture;

	BrewingStandRenderer(ITexture *texture) :
		Texture(texture)
	{
	}

	int GetTypeData(const int &data) { return data; }

	void RenderHolder(Schematic *schematic, RendererBase *renderer, const Block &block, const Point3i &position, const bool &filled)
	{
		Point2i texPos;
		int len;

		if (filled)
		{
			texPos = Point2i((13 * 16) + 7, 9 * 16);
			len = -7;
		}
		else
		{
			texPos = Point2i((13 * 16) + 9, 9 * 16);
			len = 7;
		}

		renderer->Draw(Face(Point3f(9, 0, 8), Point3f(16, 0, 8), Point3f(16, 16, 8), Point3f(9, 16, 8), Colorb::White, Texture, texPos, len, 16));

		texPos.X -= (filled) ? 7 : -7;
		len = -len;

		renderer->Draw(Face(Point3f(16, 0, 8), Point3f(9, 0, 8), Point3f(9, 16, 8), Point3f(16, 16, 8), Colorb::White, Texture, texPos, len, 16));
	}

	void Render(Schematic *schematic, RendererBase *renderer, const Block &block, const Point3i &position)
	{
		renderer->Draw(Box(Texture, Point3i(2, 14, 2), Point3i(7, 2, 7)).SetAll(Point2i((13 * 16) + 7, (9 * 16) + 2)));

		renderer->Draw(Box(Texture, Point3i(6, 2, 6), Point3i(9, 14, 5)).SetAll(Point2i((12 * 16) + 9, (9 * 16) + 5)));
		renderer->Draw(Box(Texture, Point3i(6, 2, 6), Point3i(2, 14, 1)).SetAll(Point2i((12 * 16) + 2, (9 * 16) + 1)));
		renderer->Draw(Box(Texture, Point3i(6, 2, 6), Point3i(2, 14, 9)).SetAll(Point2i((12 * 16) + 2, (9 * 16) + 9)));

		RenderHolder(schematic, renderer, block, position, block.Data & 0x1);

		renderer->Translate(8, 8, 8);
		renderer->Rotate(120, 0, 1, 0);
		renderer->Translate(-8, -8, -8);
		RenderHolder(schematic, renderer, block, position, (block.Data & 0x2) != 0);
		renderer->Translate(8, 8, 8);
		renderer->Rotate(120, 0, 1, 0);
		renderer->Translate(-8, -8, -8);
		RenderHolder(schematic, renderer, block, position, (block.Data & 0x4) != 0);
	}
};